
<div class="modal" ng-controller="KisBpmFormPropertiesPopupCtrl">
    <div class="modal-dialog modal-wide">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
                <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2>
            </div>
            <div class="modal-body">

                <div class="row row-no-gutter form-horizontal">
                    <div class="col-xs-6">
                        <div ng-if="translationsRetrieved" class="default-grid" ng-grid="gridOptions"></div>
                        <div class="pull-right">
                            <div class="btn-group">
                                <a class="btn btn-icon" rel="tooltip" data-title="{{'ACTION.MOVE.UP' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyUp()"><i class="glyphicon glyphicon-arrow-up"></i></a>
                                <a class="btn btn-icon" rel="tooltip" data-title="{{'ACTION.MOVE.DOWN' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyDown()"><i class="glyphicon glyphicon-arrow-down"></i></a>
                            </div>
                            <div class="btn-group">
                                <a class="btn btn-icon" rel="tooltip" data-title="{{'ACTION.ADD' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewProperty()"><i class="glyphicon glyphicon-plus"></i></a>
                                <a class="btn btn-icon" rel="tooltip" data-title="{{'ACTION.REMOVE' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeProperty()"><i class="glyphicon glyphicon-minus"></i></a>
                            </div>
                        </div>
                    </div>

                    <div class="col-xs-6">
                        <div ng-show="selectedProperties.length > 0">
                            <div class="form-group">
								<label for="idField" class="col-sm-3 control-label">{{'PROPERTY.FORMPROPERTIES.ID' | translate}}：</label>
								<div class="col-sm-9">
									<input id="idField" class="form-control" type="text" ng-model="selectedProperties[0].id" placeholder="{{'PROPERTY.FORMPROPERTIES.ID.PLACEHOLDER' | translate }}" />
								</div>
            				</div>
							<div class="form-group">
								<label for="nameField" class="col-sm-3 control-label">{{'PROPERTY.FORMPROPERTIES.NAME' | translate}}：</label>
								<div class="col-sm-9">
									<input id="nameField" class="form-control" type="text" ng-model="selectedProperties[0].name" placeholder="{{'PROPERTY.FORMPROPERTIES.NAME.PLACEHOLDER' | translate }}" />
								</div>
							</div>
							<div class="form-group">
								<label for="typeField" class="col-sm-3 control-label">{{'PROPERTY.FORMPROPERTIES.TYPE' | translate}}：</label>
								<div class="col-sm-9">
									<select id="typeField" class="form-control" ng-model="selectedProperties[0].type" ng-change="propertyTypeChanged()">
										<option value="string">字符串 - string</option>
										<option value="long">整数 - long</option>
										<option value="boolean">布尔 - boolean</option>
										<option value="date">日期 - date</option>
										<option value="enum">下拉 - enum</option>
									</select>
								</div>
							</div>
							<div class="form-group" ng-show="selectedProperties[0].datePattern">
								<label for="datePatternField" class="col-sm-3 control-label">{{'PROPERTY.FORMPROPERTIES.DATEPATTERN' | translate}}：</label>
								<div class="col-sm-9">
                  <select id="datePatternField" class="form-control" type="text" ng-model="selectedProperties[0].datePattern" placeholder="{{'PROPERTY.FORMPROPERTIES.DATEPATTERN.PLACEHOLDER' | translate }}">
                    <option value="YYYY-MM-DD">YYYY-MM-DD</option>
                    <option value="YYYY-MM-DD HH:mm">YYYY-MM-DD HH:mm</option>
                    <option value="YYYY-MM-DD HH:mm:ss">YYYY-MM-DD HH:mm:ss</option>
                    <option value="YYYY-MM-DD HH:mm:ss.SSS">YYYY-MM-DD HH:mm:ss.SSS</option>
                    <option value="YYYY年MM月DD日">YYYY年MM月DD日</option>
                    <option value="YYYYMMDD">YYYYMMDD</option>
                    <option value="YYYYMMDDHHmmss">YYYYMMDDHHmmss</option>
                    <option value="YYYYMMDDHHmmssSSS">YYYYMMDDHHmmssSSS</option>
                    <option value="HH:mm:ss">HH:mm:ss</option>
                    <option value="HHmmss">HHmmss</option>
                  </select>
								</div>
							</div>
                            <div ng-if="selectedProperties[0].type == 'enum'" style="padding-bottom:10px">
            			   		<div class="row row-no-gutter">
				                    <div class="col-xs-6">
				                        <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="enumGridOptions"></div>
				                        <div class="pull-right">
				                            <div class="btn-group">
				                                <a class="btn btn-icon" rel="tooltip" data-title="{{ACTION.MOVE.UP | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveEnumValueUp()"><i class="glyphicon glyphicon-arrow-up"></i></a>
				                                <a class="btn btn-icon" rel="tooltip" data-title="{{ACTION.MOVE.DOWN | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveEnumValueDown()"><i class="glyphicon glyphicon-arrow-down"></i></a>
				                            </div>
				                            <div class="btn-group">
				                                <a class="btn btn-icon" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewEnumValue()"><i class="glyphicon glyphicon-plus"></i></a>
				                                <a class="btn btn-icon" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeEnumValue()"><i class="glyphicon glyphicon-minus"></i></a>
				                            </div>
				                        </div>
				                    </div>

				                    <div class="col-xs-6">
				                        <div ng-show="selectedEnumValues.length > 0">

				                            <div class="form-group">
				            			   		<label for="classField">{{'PROPERTY.FORMPROPERTIES.VALUES.ID' | translate}}</label>
				            			   		<input type="text" id="classField" class="form-control" ng-model="selectedEnumValues[0].id" placeholder="{{'PROPERTY.FORMPROPERTIES.VALUES.ID.PLACEHOLDER' | translate}}" />
				            				</div>
				            				<div class="form-group">
				            			   		<label for="classField">{{'PROPERTY.FORMPROPERTIES.VALUES.NAME' | translate}}</label>
				            			   		<input type="text" id="classField" class="form-control" ng-model="selectedEnumValues[0].name" placeholder="{{'PROPERTY.FORMPROPERTIES.VALUES.NAME.PLACEHOLDER' | translate}}" />
				            				</div>
				                        </div>
				                        <div ng-show="selectedEnumValues.length == 0" class="muted no-property-selected" translate>PROPERTY.FORMPROPERTIES.ENUMVALUES.EMPTY</div>
				                    </div>
				                </div>
            				</div>

							<div class="form-group">
								<label for="expressionField" class="col-sm-3 control-label">{{'PROPERTY.FORMPROPERTIES.EXPRESSION' | translate}}：</label>
								<div class="col-sm-9">
									<input id="expressionField" class="form-control" type="text" ng-model="selectedProperties[0].expression" placeholder="{{'PROPERTY.FORMPROPERTIES.EXPRESSION.PLACEHOLDER' | translate }}" />
								</div>
							</div>
							<div class="form-group">
								<label for="variableField" class="col-sm-3 control-label">{{'PROPERTY.FORMPROPERTIES.VARIABLE' | translate}}：</label>
								<div class="col-sm-9">
									<input id="variableField" class="form-control" type="text" ng-model="selectedProperties[0].variable" placeholder="{{'PROPERTY.FORMPROPERTIES.VARIABLE.PLACEHOLDER' | translate }}" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">权限：</label>
								<div class="col-sm-9">
									<div class="checkbox">
										<label>
											<input id="requiredField" type="checkbox" ng-model="selectedProperties[0].required" /> {{'PROPERTY.FORMPROPERTIES.REQUIRED' | translate}}
										</label>
									</div>
									<div class="checkbox">
										<label>
											<input id="readableField" type="checkbox" ng-model="selectedProperties[0].readable" /> {{'PROPERTY.FORMPROPERTIES.READABLE' | translate}}
										</label>
									</div>
									<div class="checkbox">
										<label>
											<input id="writableField" type="checkbox" ng-model="selectedProperties[0].writable" /> {{'PROPERTY.FORMPROPERTIES.WRITABLE' | translate}}
										</label>
									</div>
								</div>
							</div>
                        </div>
                        <div ng-show="selectedProperties.length == 0" class="muted no-property-selected" translate>PROPERTY.FORMPROPERTIES.EMPTY</div>
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button>
                <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
            </div>
        </div>
    </div>
</div>
